﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XZUserSelectList.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.XZModel.XZUserSelectList" %>

<form id="pagerForm" method="post" action="XZModel/XZUserSelectList.aspx">
<input type="hidden" name="orderField" value="<%=orderField %>" />
<input type="hidden" name="orderDirection" value="<%=orderDirection %>" />
<input type="hidden" name="pageNum" value="1" />
<input type="hidden" name="numPerPage" value="<%=numPerPage %>" />
</form>
<form id="form1" runat="server" method="post" action="XZModel/XZUserSelectList.aspx" onsubmit="return dialogSearch(this);">
<div class="pageHeader">
    <div class="searchBar">
        <table class="searchContent" WIDTH="100%">
        <tr>
            <td style=" text-align:right;"><a href="#" onclick="onreturnselect()">确定已选择</a></td>
        </tr>
        <tr>
            <td><input type="text" id="returnUserName" readonly value="" style="width:100%"/></td>
        </tr>
        <tr>
            <td><input type="text" id="returnRealName" readonly value="" style="width:100%" /></td>
        </tr>
        
        </table>
    </div>
</div>
<div class="pageContent">
    <asp:repeater id="rpMenu" runat="server">
        <HeaderTemplate>
        <table class="table" width="100%" layouth="110" targetType="dialog">
        <thead>
            <tr  >                
                <th width="80" orderField="UserName" class="asc">
                    工号
                </th>
                <th orderField="RealName" class="asc"">
                    真实姓名
                </th>                
                <th width="80">
                    部门
                </th> 
                <th width="120">
                    选择
                </th>                
            </tr>
        </thead>
        <tbody>
        </HeaderTemplate>
        <ItemTemplate>
            <tr target="sid_user" rel="<%# Eval("UserId") %>">
				<td><%# Eval("UserName")%></td>
				<td><%# Eval("RealName")%></td>
				<td><%# Eval("Department")%></td>
			    <td>
					<input type="checkbox" UserName="<%# Eval("UserName") %>" RealName="<%# Eval("RealName")%>" class="XZUserSelectList_OnSelect" onclick="onselectclick($(this))"   />
				</td>
			</tr>
        </ItemTemplate>
        <FooterTemplate>
            </tbody>
         </table>
        </FooterTemplate>
    </asp:repeater>
   <%--  <div class="panelBar">
        <div class="pages">
            <span>显示</span>
            <select class="combox" name="numPerPage" onchange="dialogPageBreak({numPerPage:this.value})">
               <%=SetnumPerPage() %>
            </select>
            <span>条，共<%=TotalCount%>条</span>
        </div>
        <div class="pagination" targettype="dialog" totalcount="<%=TotalCount%>" numperpage="<%=numPerPage %>"
            pagenumshown="10" currentpage="<%=pageNum %>">
        </div>
    </div>--%>
</div>

<script type="text/javascript">
   
    function onselectclick($obj) {
        var $UserName = $obj.attr("UserName") + ",";
        var $RealName = $obj.attr("RealName") + ","; ;
        var $objreturnUserName = $("#returnUserName");
        var $objreturnRealName = $("#returnRealName");
        //删除
        var $tempstr = $objreturnUserName.val();
        $tempstr = $tempstr.replace($UserName, "");
        $objreturnUserName.val($tempstr);
        //--
        var $tempstr2 = $objreturnRealName.val();
        $tempstr2 = $tempstr2.replace($RealName, "");
        $objreturnRealName.val($tempstr2);

        if ($obj.attr("checked")) {
            $objreturnUserName.val($objreturnUserName.val() + $UserName);
            $objreturnRealName.val($objreturnRealName.val() + $RealName);
        }
    }

    function onreturnselect() {
        var $objreturnUserName = $("#returnUserName").val();
        var $objreturnRealName = $("#returnRealName").val();
        if ($objreturnUserName == "") {
            alertMsg.error("请选择员工信息");
            return;
        }
        $("#XZKaoQinAdd_RealName").val($objreturnRealName);
        $("#XZKaoQinAdd_UserName").val($objreturnUserName);
        $.pdialog.closeCurrent();
    }
</script>
</form>
